package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ByCouponMapper;
import com.ruoyi.system.domain.ByCoupon;
import com.ruoyi.system.service.IByCouponService;

/**
 * 优惠券Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-18
 */
@Service
public class ByCouponServiceImpl implements IByCouponService
{
    @Autowired
    private ByCouponMapper byCouponMapper;

    /**
     * 查询优惠券
     *
     * @param id 优惠券主键
     * @return 优惠券
     */
    @Override
    public ByCoupon selectByCouponById(Long id)
    {
        return byCouponMapper.selectByCouponById(id);
    }

    /**
     * 查询优惠券列表
     *
     * @param byCoupon 优惠券
     * @return 优惠券
     */
    @Override
    public List<ByCoupon> selectByCouponList(ByCoupon byCoupon)
    {
        return byCouponMapper.selectByCouponList(byCoupon);
    }

    /**
     * 新增优惠券
     *
     * @param byCoupon 优惠券
     * @return 结果
     */
    @Override
    public int insertByCoupon(ByCoupon byCoupon)
    {
        return byCouponMapper.insertByCoupon(byCoupon);
    }

    /**
     * 修改优惠券
     *
     * @param byCoupon 优惠券
     * @return 结果
     */
    @Override
    public int updateByCoupon(ByCoupon byCoupon)
    {
        return byCouponMapper.updateByCoupon(byCoupon);
    }

    /**
     * 批量删除优惠券
     *
     * @param ids 需要删除的优惠券主键
     * @return 结果
     */
    @Override
    public int deleteByCouponByIds(Long[] ids)
    {
        return byCouponMapper.deleteByCouponByIds(ids);
    }

    /**
     * 删除优惠券信息
     *
     * @param id 优惠券主键
     * @return 结果
     */
    @Override
    public int deleteByCouponById(Long id)
    {
        return byCouponMapper.deleteByCouponById(id);
    }
}
